﻿<div id="grid_primary_@ViewBag.Subject.ID" style="text-align: center"></div>

<script>
    $(function () {
        $("#grid_primary_@ViewBag.Subject.ID").kendoGrid({
            columns: [{
                title: "性别",
                field: "Sex",
                template: "#=GetSexString(Sex)#",
                width: 80
            }, {
                title: "成绩",
                field: "Mark",
                template:"#=ShowMark(Mark)#",
                width: 120
            }, {
                title: "得分",
                field: "Score",
                width: 80
                @if(!ViewBag.Additional){
                    <text>
                    }, {
                        title: "等级",
                        field: "Level",
                        width: 120
                    </text>
                }
            }, {}],
            dataSource: Whale.dataSource({
                url: "/Standard/Evaluation/Gets",
                getParameters: function () {
                    return {
                        gradeCode: "@ViewBag.GradeCode",
                        subjectID: "@ViewBag.Subject.ID",
                        additional: "@ViewBag.Additional"
                    }
                },
                pageSize: 20
            }),
            pageable: {
                messages: {
                    empty: "暂无数据"
                }
            },
            dataBound: function (e) {
                //让表头居中
                $("th.k-header").attr("style", "text-align:center; font-weight:bold;");
            }
        });
    });

    function ShowMark(mark) {
        if ("@ViewBag.Subject.Category" == "3"){
            return ShowTime(mark);
        }
        else
            return mark;
    }
</script>